package com.database.interceptor;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.database.methods.MySqlInsertListBatch;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author zhang
 * @create 2023/8/2 11:30
 */
@Component
public class MyCustomSqlMethodInjector extends DefaultSqlInjector {

    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
        List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
        methodList.add(new MySqlInsertListBatch("insertListBatch"));
        return methodList;
    }
}
